@page "/alertSetting"
@namespace SwashbucklerDiary.Rcl.Pages
@inherits ImportantComponentBase

<MyAppBar Title="@(I18n.T("Snackbars"))"
          OnClick="NavigateToBack">
</MyAppBar>

<ScrollContainer>
    <MCard Class="mb-5"
           Elevation="0"
           Rounded="@("lg")">
        <MList Class="py-0">
            <MListItem OnClick="() => showTimeout = true">
                <MListItemIcon>
                    <MIcon>
                        timer
                    </MIcon>
                </MListItemIcon>

                <MListItemContent Style="flex-basis:50%;">
                    <wc-auto-scroll-text>@(I18n.T("Alert timeout"))</wc-auto-scroll-text>
                </MListItemContent>

                <MListItemContent Class="ml-2" Style="flex-basis:50%;">
                    <MListItemSubtitle>
                        <wc-auto-scroll-text class="justify-end">@TimeoutText</wc-auto-scroll-text>
                    </MListItemSubtitle>
                </MListItemContent>

                <MListItemAction>
                    <MIcon>chevron_right</MIcon>
                </MListItemAction>
            </MListItem>
        </MList>
    </MCard>

    <MCard Class="mb-5"
           Elevation="0"
           Rounded="@("lg")">
        <MList Class="py-0">
            <MListItem>
                <MListItemIcon>
                    <MIcon>
                        trophy
                    </MIcon>
                </MListItemIcon>
                <MListItemContent>
                    <wc-auto-scroll-text>@(I18n.T("Achievement"))</wc-auto-scroll-text>
                </MListItemContent>
                <MListItemAction>
                    <SettingSwitch @bind-Value="achievementsAlert"
                                   SettingKey="@nameof(Setting.AchievementsAlert)">
                    </SettingSwitch>
                </MListItemAction>
            </MListItem>
        </MList>
    </MCard>

</ScrollContainer>

<SelectChipDialog @bind-Visible="showTimeout"
                  @bind-Value="@timeout"
                  @bind-Value:after="UpdateSetting"
                  Title="@(I18n.T("Alert timeout"))"
                  Items="timeoutItems"
                  Mandatory="true">
</SelectChipDialog>
